require 'rexml/document'
require 'html/xmltree'

miss =  []

BlogspotCrawl.find_each(:conditions => "status = 200") {|c|
  parser = HTMLTree::XMLParser.new false, true
  begin
    parser.feed c.body  
  rescue REXML::ParseException => e
    # continue with a partial prased document
    p e
  end
  
  continue_button = REXML::XPath.match parser.document.root, '//a[@id = "continueButton"]'
  if continue_button.length == 1 then
    miss << c.id
    c.status = nil
    c.save
    p c
  end
}

p "Finis"
p miss.length
